﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Practices.Prism.ViewModel;
using System.Windows.Input;
using System.Windows;
using Microsoft.Practices.Prism.Commands;
using Microsoft.Practices.Prism.Events;
using Infrastructure.Events;
using Microsoft.Practices.Prism.Regions;
using Microsoft.Practices.Unity;
using Infrastructure.Account;

namespace UserAccountModule.ViewModels
{
    public class AccountManagerNavGroupViewModel : NotificationObject
    {

        #region Fields
        IEventAggregator eventAggregator;
        IUnityContainer container;
        IRegionManager regionManager;

        // Property variables
        public string Title { get; set; }
        public string Header { get; set; }
        public string LargeIcon { get; set; }
        public string SmallIcon { get; set; }
        #endregion

        #region Constructor
        /// <summary>
        /// Default constructor.
        /// </summary>
        public AccountManagerNavGroupViewModel(IEventAggregator eventAggregator, IRegionManager regionManager, IUnityContainer container)
        {
            this.container = container;
            this.eventAggregator = eventAggregator;
            this.regionManager = regionManager;
            this.Initialize();

            //this.ShowDonViViewCommand = container.Resolve<ShowDonViViewCommand>(
            //    new ParameterOverrides 
            //    {
            //        {"viewModel", this}
            //    }.OnType<ShowDonViViewCommand>()
            //);
        }
        #endregion

        #region Command Properties
        public ICommand ShowDonViViewCommand { get; set; }
        #endregion

        #region Administrative Properties
        public IRegionManager RegionManager
        {
            get { return regionManager; }
        }

        public IEventAggregator EventAggregator
        {
            get { return eventAggregator; }
        }

        public IUnityContainer Container
        {
            get { return container; }
        }
        #endregion

        #region Event Handlers

        #endregion

        #region Private Methods
        /// <summary>
        /// Initializes the view model.
        /// </summary>
        private void Initialize()
        {
            // Initialize the UI properties
            this.Title = ActiveAccount.Instance.TenTaiKhoan;
            this.Header = ActiveAccount.Instance.TenTaiKhoan;
            this.LargeIcon = "/Infrastructure;component/Images/User_24x24.png";
            this.SmallIcon = "/Infrastructure;component/Images/User_20x20.png";
        }
        #endregion
    }
}
